package com.example.service;

import static androidx.constraintlayout.helper.widget.MotionEffect.TAG;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;

import androidx.annotation.Nullable;

public class FirstService extends Service {
    String TAG=FirstService.class.getName();

private class InnerBinder extends Binder implements ICommucation{
        public void callServiceInnerMethod() {
            sayHello();
        }

    }


    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.d(TAG,"onBind...");
        return new InnerBinder();
    }

public void onCreate()
{
    super.onCreate();

    Log.d(TAG,"oncreate");
}

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.d(TAG,"onStartCommand...");
        return super.onStartCommand(intent, flags, startId);
    }



public void onDestroy(){
        super.onDestroy();
        Log.d(TAG,"onDestroy");
}

public void sayHello(){
    Toast.makeText(this, "Hello", Toast.LENGTH_SHORT).show();
}



}
